package com.kangfu.api.service.impl;

import com.kangfu.api.service.IMedicalRecordService;
import com.kangfu.db.mapper.MedicalRecordMapper;
import com.kangfu.db.model.vo.MedicalRecordInfoVo;
import com.kangfu.db.model.vo.MedicalRecordVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class MedicalRecordServiceImpl implements IMedicalRecordService {

    @Autowired
    public MedicalRecordMapper medicalRecordMapper;

    @Override
    public List<MedicalRecordVo> getMedicalRecordList(int userId, int page) {

        int pageSize = 5;
        int offset = (page - 1) * pageSize;

        List<MedicalRecordVo> list = medicalRecordMapper.getMedicalRecordList(userId, offset, pageSize);

        return list;
    }

    @Override
    public MedicalRecordInfoVo getMedicalRecordInfo(int id) {
        MedicalRecordInfoVo medicalRecordInfoVo = medicalRecordMapper.getMedicalRecordInfo(id);
        return medicalRecordInfoVo;
    }


}
